<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height border-hover-style outline-style2">
    <div class="Showroom-parent" v-if="props.info.digitalShowroom">
      <digitalShowroomInfo :url="props.info.digitalShowroom" :id="props.info.id" />
    </div>
    <img class="outline-parent-bg" :src="publicUrls + 'free/style4/Level1outlineStyle8Bg.webp'" alt="" />
    <div class="outline jy-style-height">
      <div class="content-tiitle">
        {{ props.info.text }}
      </div>

      <div class="outline-content" v-if="props.info.subTitle || props.info.value || props.info.remarks">
        <p class="outline-subTitle" v-if="props.info.subTitle">——{{ props.info.subTitle }}</p>
        <div class="remarks1" v-if="props.info.value && props.info.remarks">
          <TextMax
            :infoData="props.info"
            v-if="props.domShow"
            :data="props.info.remarks"
            :title="props.info.text"
            :row="getRemarksNum(7, route.meta.loopType)"
          ></TextMax>
        </div>
        <div
          class="remarks2"
          :class="{
            remarks3: !props.info.subTitle,
          }"
          v-else-if="props.info.remarks"
        >
          <TextMax
            :infoData="props.info"
            v-if="props.domShow"
            :data="props.info.remarks"
            :title="props.info.text"
            :row="
              !props.info.subTitle ? getRemarksNum(17, route.meta.loopType) : getRemarksNum(15, route.meta.loopType)
            "
          ></TextMax>
        </div>
        <div
          class="img-box"
          v-if="props.info.value"
          :class="{
            'img-box-1': props.info.subTitle && !props.info.remarks,
            'img-box-2': !props.info.subTitle && !props.info.remarks,
          }"
        >
          <div class="outline-cover">
            <img @click="ImgVisible = true" :src="urls + props.info.value + '?imageView2/3/format/webp'" alt="" />
          </div>
        </div>
      </div>
    </div>
  </div>
</template> 

<script lang="ts">
export default defineComponent({
  name: 'free13Style7',
});
</script>

<script setup lang="ts">
import { getRemarksNum } from '@/utils/minxin';
import { publicUrls, textType } from '@/utils/minxin';
import { getTextHtml } from '@/utils/minxin';
import digitalShowroomInfo from '@/freeComponents/unitdigitalShowroom/style4.vue';
import { urls } from '@/utils/request/upload';
import { defineComponent, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/TextMax.vue';
import { useProjectStore } from '@/store';
import { transform } from 'lodash';
import { useRouter, useRoute } from 'vue-router';
const route = useRoute();
const ImgVisible = ref(false);
const store = useProjectStore();

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  position: relative;
  margin-right: 90px;
  margin-top: 0;
  margin-left: 120px;
  .Showroom-parent {
    position: absolute;
    top: 30px;
    right: 10px;
    z-index: 23;
  }
}
.outline-parent-bg {
  width: 520px;
  height: 100%;
  position: relative;
  z-index: 20;
}
.outline {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  padding: 110px 88px 0px 72px;
}
.content-tiitle {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 360px;
  height: 96px;
  font-family: 'SourceHanSerifCN-Bold';
  font-weight: bold;
  font-size: 32px;
  color: rgba(24, 107, 183, 1);
  line-height: 48px;
  text-align: center;
}

.outline-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  overflow: hidden;
  .outline-subTitle {
    width: 360px;
    height: 56px;
    color: rgba(24, 107, 183, 1);
    text-align: center;
    font-family: 'SourceHanSerifCN';
    font-size: 18px;
    line-height: 28px;
    margin-top: 8px;
  }
}
.remarks1 {
  width: 360px;
  margin-top: 16px;
}
.remarks2 {
  display: flex;
  align-items: center;
  width: 360px;
  min-height: 460px;
  margin-top: 16px;
}
.remarks3 {
  display: flex;
  align-items: center;
  width: 360px;
  min-height: 508px;
  margin-top: 16px;
}
.img-box {
  margin-top: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  width: 360px;
  height: 250px;
  .outline-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 360px;
    height: 250px;
    overflow: hidden;
    img {
      transition: all 0.3s;
      width: 360px;
      height: 100%;

      object-fit: cover;
    }
  }
}
.img-box-1 {
  margin-top: 16px;
  width: 360px;
  height: 460px;
  .outline-cover {
    width: 360px;
    height: 460px;
  }
}
.img-box-2 {
  margin-top: 16px;
  width: 360px;
  height: 520px;
  .outline-cover {
    width: 360px;
    height: 520px;
  }
}
.img-box:hover {
  .outline-cover {
    img {
      transform: scale(1.2);
    }
  }
}

::v-deep .textMore-box {
  width: 360px;
  flex-shrink: 0;
}
::v-deep .van-text-ellipsis {
  color: rgba(51, 51, 51, 0.8) !important;
  font-family: 'PingFang SC' !important;
  font-size: 16px !important;
  font-style: normal;
  font-weight: 400;
  line-height: 32px; /* 200% */
  opacity: 0.8;
}
::v-deep .van-text-ellipsis__action::before {
  color: #83b0b3 !important;
  font-family: 'PingFang SC' !important;
  font-size: 16px !important;
  font-style: normal;
  font-weight: 500;
  line-height: 32px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
</style>